package com.nondo.rdp.stock.common;

/**
 * 华尔街见闻数据源
 */
public class WallstreetDataSource {
    //列表数据
    public final static String URL_LIST = "https://mdc.wallstreetcn.com/stocklist"; //?limit=15&page=1
    public final static String URL_LIST_DATA = "https://mdc.wallstreetcn.com/real";
    public final static String URL_LIST_DATA_PARAM = "fields=prod_name,preclose_px,price_precision,open_px,high_px,low_px,update_time,last_px,px_change,px_change_rate,trade_status&en_prod_code=";

    //股票基本数据
    public final static String URL_REAL = "https://mdc.wallstreetcn.com/real";
    public final static String URL_REAL_PARAM = "fields=prod_name,last_px,px_change,px_change_rate,high_px,low_px,open_px,preclose_px,business_amount,business_balance,market_value,turnover_ratio,dyn_pb_rate,amplitude,pe_rate,bps,hq_type_code,trade_status,bid_grp,offer_grp,business_amount_in,business_amount_out,circulation_value,securities_type,update_time,price_precision&en_prod_code=";//000002.SZ

    //各种指数
    public final static String URL_REAL_THREE_PARAM = "en_prod_code=000001.SS,399001.SZ,399006.SZ&fields=prod_name,last_px,px_change,px_change_rate,price_precision";

    //涨跌列表
    public final static String URL_UP_DOWN = "https://mdc.wallstreetcn.com/sort";
    public final static String URL_UD_HOME_UP_PARAM = "data_count=10&fields=prod_name,last_px,px_change,px_change_rate,price_precision,update_time&sort_type=1";
    public final static String URL_UD_HOME_DOWN_PARAM = "data_count=10&fields=prod_name,last_px,px_change,px_change_rate,price_precision,update_time&sort_type=0";
    public final static String URL_UD_PARAM = "data_count=20&fields=prod_name,last_px,px_change,px_change_rate,price_precision,update_time";

    //股票分时图追踪数据
    public final static String URL_TREND = "https://mdc.wallstreetcn.com/trend";
    public final static String URL_TREND_PARAM = "fields=min_time,last_px,avg_px,business_amount,business_balance&prod_code=";//000002.SZ

    //K先数据
    public final static String URL_KLINE = "https://mdc.wallstreetcn.com/kline";
    public final static String URL_KLINE_PARAM = "fields=turnover_ratio,min_time,open_px,close_px,high_px,low_px,business_amount,business_balance,ma5,ma10,ma20,ma60&adjust_price_type=forward";

    //搜索
    public final static String URL_SEARCH = "https://mdc.wallstreetcn.com/finance_search";
    public final static String URL_SEARCH_PARAM = "q=";//接搜索关键字

    /**
     * 获取K线图的完整参数
     *
     * @param prod_code     string 股票代码
     * @param candle_period int K线类型
     * @param data_count    int 总数据
     * @return
     */
    public static String getUrlKParam(String prod_code, int candle_period, int data_count, String adjust_price_type) {
        String url = URL_KLINE_PARAM + "&prod_code=" + prod_code + "&candle_period=" + candle_period + "&data_count=" + data_count + "&adjust_price_type=" + adjust_price_type;
        return url;
    }
}